#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
char* my_strncat(char*des,char* src,int num)
{
	assert(des && src);
	char* ret = des;
	if (*src == '\0')
		return des;
	while (*des != '\0')
	{
		des++;
	}
	while (num&&*src!='\0')
	{
		*des++ = *src++;
		num--;
	}
	if (num > 0)
	{
		*des++ = '\0';
		num--;
	}
	return ret;

}
int main()
{
	char arr1[20] = "abcdef";
	char arr2[] = "ghi";
	int num = 3;
	printf("%s",my_strncat(arr1, arr2, num));
	return 0;
}